package basis.io;

import java.io.*;

public class TestMain {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        TestSerialize obj = new TestSerialize(10, "Beney");
        String fp = "src/main/java/storage";
        try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fp))) {
            oos.writeObject(obj);
        }

        try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(fp))) {
            TestSerialize o = (TestSerialize) ois.readObject();
            System.out.println(o);
        }
    }
}
